package view;


import javax.swing.JPanel;
import javax.swing.SpringLayout;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JButton;

public class Purchase_Department1 extends JPanel{
	private JTable table;
	private final JButton btnPurchaseOrder = new JButton("PURCHASE ORDER");
	public Purchase_Department1() {
		SpringLayout springLayout = new SpringLayout();
		springLayout.putConstraint(SpringLayout.WEST, btnPurchaseOrder, 220, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, btnPurchaseOrder, -10, SpringLayout.SOUTH, this);
		setLayout(springLayout);
		
		JScrollPane scrollPane = new JScrollPane();
		springLayout.putConstraint(SpringLayout.SOUTH, scrollPane, -6, SpringLayout.NORTH, btnPurchaseOrder);
		springLayout.putConstraint(SpringLayout.EAST, scrollPane, -10, SpringLayout.EAST, this);
		springLayout.putConstraint(SpringLayout.NORTH, scrollPane, 10, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, scrollPane, 10, SpringLayout.WEST, this);
		add(scrollPane);
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"SR.NO.", "ITEM CODE", "ITEM DESRCRIPTION", "REQUIREMENT", "BALANCE", "PURCHASE", "TIME SCHEDULE", "CHECK BOX"
			}
		) {
			boolean[] columnEditables = new boolean[] {
				false, false, false, false, false, false, false, true
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		scrollPane.setViewportView(table);
		add(btnPurchaseOrder);
	}

}
